var a,
  t = require("../../res/www.a9a.cn.js"),
  i = getApp();
Page({
  data: { ifwin: !0 },
  onLoad: function (e) {
    var n = e.tguid,
      g = e.admid;
    (n = i.empty(n) ? 0 : n), (g = i.empty(g) ? 0 : g);
    var o = this;
    (a = wx.getStorageSync("COOK_U")),
      console.log("tg-login->  tguid=" + n),
      console.log("tg-login->  admid=" + g),
      i.ajax({
        url: "tg.php",
        data: { submitok: "loading", openid: a.openid },
        success: function (a) {
          switch (a.flag) {
            case "1":
            case 1:
              switch (
                (o.setData({
                  tguid: n,
                  loading: a.loading,
                  path_s: a.loading.path_s,
                  path_s_url: a.loading.path_s_url,
                  color: a.color,
                  rgbcolor: t.c16_rgb(a.color),
                  h1: a.h1,
                  h5: a.h5,
                  MB: a.MB,
                }),
                a.t)
              ) {
                case "flag0":
                case "flag_1":
                case "flag2":
                  wx.reLaunch({ url: "reg?t=" + a.t });
                  break;
                case "flag1":
                  wx.reLaunch({ url: "my" });
              }
              break;
            default:
              wx.showToast({ title: a.msg, icon: "none", mask: !0 });
          }
        },
      }),
      i.get_navigationBarTopHeight(this);
  },
  ifagreeFn: function (a) {
    1 == a.detail.value
      ? this.setData({ ifwin: !1 })
      : this.setData({ ifwin: !0 });
  },
  btnFn: function () {
    t.empty(this.data.MB) || i.openSetting(this.data.MB),
      this.setData({ div_login: !0 });
  },
  back: function () {
    this.setData({ div_login: !1 });
  },
  getPhoneNumber: function (a) {
    var t = this.data.tguid;
    i.getPhoneNumber({
      e: a,
      submitok: "tg_reg_addupdate",
      tguid: t,
      url: "reg",
      urlkind: "reLaunch",
    });
  },
  onShareAppMessage: function () {
    return {
      imageUrl: this.data.loading.share.imgurl,
      title: this.data.loading.share.title,
      path: "/pages/tg/login",
    };
  },
  onShareTimeline: function () {
    return {
      imageUrl: this.data.loading.share.imgurl,
      title: this.data.loading.share.title,
      query: "",
      path: "/pages/tg/login",
    };
  },
  privacy_agree: function (a) {
    console.log("agree");
  },
  privacy_disagree: function (a) {
    console.log("disagree"), wx.exitMiniProgram();
  },
});
